{include file="index/header" /}
<body>
<div class="panel admin-panel margin-top" id="add">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 增加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:url('admin/edit')}">    
      <div class="form-group">
        <div class="label">
          <label>用户名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$admin_data.admin_name}" name="admin_name" placeholder="请输入用户名" data-validate="required:请输入用户名" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>手机号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$admin_data.phone}" name="phone" placeholder="请输入手机号" data-validate="required:请输入手机号,number:必须为数字,regexp#1[345678]\d{9}$:必须是手机号格式" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>密码：</label>
        </div>
        <div class="field">
          <input type="password" class="input w50" value="" name="admin_password" placeholder="请输入原密码 不修改密码请留空" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>密码：</label>
        </div>
        <div class="field">
          <input type="password" class="input w50" value="" name="newpass" placeholder="请输入新密码 不修改密码请留空" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>确认密码：</label>
        </div>
        <div class="field">
          <input type="password" class="input w50" value="" name="repassword" placeholder="请再次输入新密码 不修改密码请留空" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
          <div class="label">
            <label>角色：</label>
          </div>
          <div class="field">
          <table class="table table-hover">
            <tr>
                {foreach name='role_data' item='role' key='k'}
                  {if (($k%5) eq 0) && ($k neq 0)}
                  </tr>
                  {/if}
                  <td><input  type="checkbox" name="role_id[]" value="{$role.role_id}" {in name="$role.role_id" value="$admin_data.role_id"}checked=""{/in}/>{$role.role_name}</td>
                {/foreach}
              </tr>
            </table> 
            <div class="tips"></div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>课程：</label>
          </div>
          <div class="field" style="padding-top:8px;"> 
           <table class="table table-hover">
            <tr>
                {foreach name='nav_data' item='nav' key='k'}
                  {if (($k%5) eq 0) && ($k neq 0)}
                  </tr>
                  {/if}
                  <td><input  type="checkbox" name="nav_id[]" value="{$nav.nav_id}" <?php if(in_array($nav['nav_id'],$arr)){echo 'checked';}?>/>{$nav.nav_name}</td>
                {/foreach}
              </tr>
            </table>
          </div>
        </div>
      <input type="hidden" name="admin_id" value="{$admin_data.admin_id}">
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body></html>